import java.util.Random;
import model.ActionType;
import model.Game;
import model.Hockeyist;
import model.Move;
import model.World;

/**
 *
 * @author Constantine Tretyak
 */
public class Test extends AbstractStrategy {

    public Test(Hockeyist self, World world, Game game, Move move) {
        super(self, world, game, move);
    }

    private static Point p;

    @Override
    public void run() {
        if (self.getTeammateIndex() == 0) {
            defendNet(true);
//            move.setSpeedUp(1.0d);
//            move.setTurn(self.getAngleTo(puck));
        } else {

            defendNet(false);
        }

        if (self.getDistanceTo(puck) < game.getStickLength() && moving.atSector(self, puck, game.getStickSector())) {
            move.setAction(ActionType.STRIKE);
        }
    }

    public void generatePoint() {
        Random rnd = new Random();
        double randomX = -1.0d + (1.0d + 1.0d) * rnd.nextDouble();
        double randomY = -1.0d + (1.0d + 1.0d) * rnd.nextDouble();
//        p = new Point(5, coords.getXcoord(randomX), coords.getYcoord(randomY));
        p = new Point(30, coords.getXcoord(0.9d), coords.getYcoord(0.4d));
        System.out.println(randomX + ":" + randomY);
    }
}
